// 仓库
import {
	defineStore
} from 'pinia'
import {
	getInfoByTokenApi
} from '../api/login'

export const useUserStore = defineStore('user', {
	state: () => {
		return {
			// 保存当前登录的用户信息，初始为空
			userInfo: null,
			signId: null,
		}
	},
	actions: {
		async getUserInfo() {
			console.log(2);
			const res = await getInfoByTokenApi();
			if (res.code == 200) {
				this.userInfo = res.data;
			}

		}
	}
})